package com.cadre.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cadre.system.domain.officer.B01;
import com.cadre.system.domain.officer.B04;
import com.cadre.system.mapper.B04Mapper;
import com.cadre.system.service.B01Service;
import com.cadre.system.service.B04Service;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service("b04Service")
/* loaded from: B04ServiceImpl.class */
public class B04ServiceImpl extends ServiceImpl<B04Mapper, B04> implements B04Service {

    @Resource
    private B01Service b01Service;
    @Override // com.tdqy.cadre.modular.profess.service.B04Service
    public List<B04> selectList(String unitId) {
        LambdaQueryWrapper<B04> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(B04::getUnitid, unitId);
        List<B04> b04s = this.baseMapper.selectList(lambdaQueryWrapper);
        b04s.stream().forEach(b04 ->{
            B01 b01 = b01Service.selectById(b04.getFlowid());
            b04.setB01(b01);
        });
        return b04s;
    }

    @Override // com.tdqy.cadre.modular.profess.service.B04Service
    @Transactional(rollbackFor = {Exception.class})
    public int updateByPrimaryKeySelective(B04 b04) {
        return updateByPrimaryKeySelective(b04);
    }

    @Override // com.tdqy.cadre.modular.profess.service.B04Service
    public List<Map<String, Object>> getCountForMap(String unitid) {
        return this.baseMapper.getCountForMap(unitid);
    }
}
